package com.sky.controller.user;

import com.sky.pojo.Category;
import com.sky.result.Result;
import com.sky.service.admin.CategoryService;
import com.sky.service.admin.DishService;
import com.sky.vo.DishVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/user/category")
@Api("菜品浏览接口")
@Slf4j
public class UserCategoryController {

    @Autowired
    private CategoryService categoryService;


    /**
     * 查询分类
     * @param
     * @return
     */
    @GetMapping("/list")
    @ApiOperation("查询分类")
    public Result<List<Category>> list(){

        List<Category> list= categoryService.listAll();

        return Result.success(list);
    }
}
